package com.monitor.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.monitor.dao.ErpMaterielFlowSummaryMapper;
import com.monitor.entity.ErpMaterielFlowSummary;
import com.monitor.service.ErpMaterielFlowSummaryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 物料流转统计表 服务实现类
 * </p>
 *
 * @author LX
 * @since 2018-09-08
 */
@Service
public class ErpMaterielFlowSummaryServiceImpl extends ServiceImpl<ErpMaterielFlowSummaryMapper, ErpMaterielFlowSummary> implements ErpMaterielFlowSummaryService {

    @Resource
    private ErpMaterielFlowSummaryMapper flowSummaryMapper;


    @Override
    public Integer getMatOutNum(Integer matId, Integer wareId, String startDate, String endDate) {
        try {
            return flowSummaryMapper.getMatOutNum(matId,wareId,startDate,endDate);
        }catch (Exception e){
            e.printStackTrace();
            return 0;
        }


    }

    @Override
    public Integer getMatInNum(Integer matId, Integer wareId, String startTime, String endDate) {
        return flowSummaryMapper.getMatInNum(matId,wareId,startTime,endDate);
    }

    @Override
    public List<ErpMaterielFlowSummary> getSummary(Integer matId, Integer wareId, String startDate) {
        return flowSummaryMapper.getSummary(matId,wareId,startDate);
    }

    @Override
    public List<ErpMaterielFlowSummary> getSummaryList(Integer matId, Integer wareId, String startDate, String endDate) {
        return flowSummaryMapper.getSummaryList(matId,wareId,startDate,endDate);
    }

    @Override
    public List<ErpMaterielFlowSummary> getOutMaterielToDate(Integer matId, Integer wareId, String startDate, String endDate) {
        return flowSummaryMapper.getOutMaterielToDate(matId,wareId,startDate,endDate);
    }

    @Override
    public List<ErpMaterielFlowSummary> getGoMaterielToDate(Integer marId, Integer wareId, String startDate, String endDate) {
        return flowSummaryMapper.getGoMaterielToDate(marId,wareId,startDate,endDate);
    }
}
